var PerfilItemRender = new Class({
	"Extends":js.underas.controller.ListViewItemRender
	,"initialize":function(p_obj){						
		var htmlTmp = '<h4>'+p_obj.descricao+'</h4>';
		htmlTmp += '<span>'+p_obj.comentario+'</span>';
		this.parent('div',htmlTmp);
		this.getEle().addClass("col-xs-12 col-sm-12 col-md-12");
		}
	});



var Perfil = new Class({
	"Extends":js.underas.container.ModWindow
	,"itIdPerfil":null	 
	,"itNome":null	 
	,"itComentario":null
	,"itSnAtivo":null	 
	,"initialize":function(){
		this.parent("Perfil");
		this.setRevision("$Revision: 143 $");	
		this.setSize(3);

		this.itIdPerfil = new js.underas.controller.InputText("");
		this.itIdPerfil.setColumn("$_id");
		this.itIdPerfil.setLabel("cod.");
		this.itIdPerfil.setEnable(false);	
		this.itIdPerfil.setSize(4);	
		this.append(this.itIdPerfil);

		this.itNome = new js.underas.controller.InputText("");
		this.itNome.setColumn("@descricao");
		this.itNome.setLabel("descricao");
		this.itNome.setSize(8);	
		this.append(this.itNome);

		this.itSnAtivo = new js.underas.controller.CheckBox("Ativo?","Sim");
		this.itSnAtivo.setCheckedValue("S");
		this.itSnAtivo.setUnCheckedValue("N");
		this.itSnAtivo.setColumn("@snAtivo");
		this.itSnAtivo.setSize(12);
		this.append(this.itSnAtivo);

		this.itComentario = new js.underas.controller.InputText("");
		this.itComentario.setColumn("@comentario");
		this.itComentario.setLabel("comentario");
		this.itComentario.setSize(12);	
		this.append(this.itComentario);	
		
		this.mainList = new js.underas.controller.ListView("Perfil");
		this.mainList.setItemRender("PerfilItemRender");
		//this.setMainList("mainList");
		this.mainTb = new js.underas.net.ToolBar({"domain":"perfil/perfil"});

		this.append(this.mainTb);		
		this.append(this.mainList);		
		//this.addAssociation({"mod":"br.net.atasacramental.usuario.view.Usuario","embed":"usuarios","puid":this.getVarModule()});
		this.addAssociation({"mod":"br.net.atasacramental.menu.view.Menu","puid":this.getVarModule(),"embed":"menus"});
	
		//this.addAssociation({"mod":"br.net.atasacramental.usuario.view.Usuario","act":"getByIdPerfil","puid":this.getVarModule()});
		//this.addAssociation({"mod":"br.net.atasacramental.notificacao.view.ConfigNotificacao","puid":this.getVarModule(),"embed":"notificacoes"});
		
	}
	,"onStart":function(){
		//this.mainTb.activate(true);
		this.mainTb.reloadItens();
	}
});
